createAddnewContainer.js ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
nop 0
1
export function createAddnewContainer(container, translation = {close: '', address: ''}) {
2
    let overlay = document.createElement('div');
3
4
    overlay.setAttribute('class', 'bg-overlay add-new-address');
5
    overlay.innerHTML = `
6
        <div class="close" data-action="close" title="${translation.close}">&#9587;</div>
7
        <div class="valign">
8
            <div class="edit-marker-form">
9
                <label for="address">${translation.address}</label>
10
                <input type="text" name="address" id="address" placeholder="${translation.address}" class="add-marker-form__address"/>
11
            </div>
12
        </div>
13
    `;
14
15
    container.append(overlay);
16
17
    overlay.querySelector('*[data-action="close"]').addEventListener('click', () => overlay.parentNode.removeChild(overlay));
18
19
    return overlay;
20
}